From 412b25c8282eec67db198786978266e46c00bc46 Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Fri, 8 Jul 2011 11:44:23 +0100 Subject: [PATCH] x86/mm: fix 32-bit p2m type lookups 23300:4b0692880dfa moved a check for 0 into p2m_flags_to_type() and removed it from its caller, but the new check is only compiled in 64-bit builds. Signed-off-by: Tim Deegan --- xen/include/asm-x86/p2m.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h index dad0f34807..e4c118ce46 100644 --- a/xen/include/asm-x86/p2m.h +++ b/xen/include/asm-x86/p2m.h @@ -597,12 +597,11 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn, /* Extract the type from the PTE flags that store it */ static inline p2m_type_t p2m_flags_to_type(unsigned long flags) { - /* Type is stored in the "available" bits */ -#ifdef __x86_64__ /* For AMD IOMMUs we need to use type 0 for plain RAM, but we need * to make sure that an entirely empty PTE doesn't have RAM type */ if ( flags == 0 ) return p2m_invalid; +#ifdef __x86_64__ /* AMD IOMMUs use bits 9-11 to encode next io page level and bits * 59-62 for iommu flags so we can't use them to store p2m type info. */ return (flags >> 12) & 0x7f; -- 2.30.2